package ead.cs.service.impl;

import ead.cs.domain.Ship;
import ead.cs.repository.ShipRepository;
import ead.cs.service.ShipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShipServiceImpl implements ShipService {

    @Autowired
    private ShipRepository shipRepository;

    @Override
    public void save(Ship ship) {
        shipRepository.save(ship);
    }

    @Override
    public Ship findByReferenceId(String referenceId) {
        return shipRepository.findByReferenceId(referenceId);
    }

    @Override
    public List<Ship> findAll() {
        return shipRepository.findAll();
    }

    @Override
    public Ship findOne(String id) {
        return shipRepository.findOne(id);
    }
}
